home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Hyper
/
Q-R
/
Q&A.cpt
/
Cosmology
/
stack.txt
< prev
Wrap
Text File
|
1987-12-01
|
6KB
|
204 lines
-- stack: in
-- format: 8 (HyperCard 1)
-- flags: 0x0 (none)
-- protect password hash: 0
-- maximum user level: 5 (scripting)
-- window: Rect(x1=0, y1=0, x2=0, y2=0)
-- screen: Rect(x1=0, y1=0, x2=0, y2=0)
-- card dimensions: w=0 h=0
-- scroll: x=0 y=0
-- background count: 1
-- first background id: 2623
-- card count: 8
-- first card id: 2963
-- list block id: 3921
-- print block id: 3540
-- font table block id: 0
-- style table block id: 0
-- free block count: 0
-- free size: 0 bytes
-- total size: 18304 bytes
-- stack block size: 5120 bytes
-- created by hypercard version: 0x00000000
-- compacted by hypercard version: 0x00000000
-- modified by hypercard version: 0x00000000
-- opened by hypercard version: 0x00000000
-- patterns[0]: 0x0000000000000000
-- patterns[1]: 0x0000220000002200
-- patterns[2]: 0x8800220088002200
-- patterns[3]: 0xCC003300CC003300
-- patterns[4]: 0xCC883322CC883322
-- patterns[5]: 0xFF00FF00FF00FF00
-- patterns[6]: 0xEECCBB33EECCBB33
-- patterns[7]: 0xFFCCFF33FFCCFF33
-- patterns[8]: 0xFFEEFFBBFFEEFFBB
-- patterns[9]: 0xFFFFFFBBFFFFFFBB
-- patterns[10]: 0x8010022001084004
-- patterns[11]: 0xFFFFFFFFFFFFFFFF
-- patterns[12]: 0x8822882288228822
-- patterns[13]: 0x1122448811224488
-- patterns[14]: 0xC4800C6843023026
-- patterns[15]: 0xB130031BD8C00C8D
-- patterns[16]: 0xAA00AA00AA00AA00
-- patterns[17]: 0x8822552288225522
-- patterns[18]: 0x8855225588552255
-- patterns[19]: 0x77DD77DD77DD77DD
-- patterns[20]: 0x8000000000000000
-- patterns[21]: 0xAA55AA55AA55AA55
-- patterns[22]: 0x5555555555555555
-- patterns[23]: 0x8244394482010101
-- patterns[24]: 0x8814224188412214
-- patterns[25]: 0x8080413E080814E3
-- patterns[26]: 0x22048C7422179810
-- patterns[27]: 0xBE808808EB088880
-- patterns[28]: 0x25C8328964244C92
-- patterns[29]: 0xA29C41BE2AC914EB
-- patterns[30]: 0x40A00000040A0000
-- patterns[31]: 0x8040200002040800
-- patterns[32]: 0xAA00800088008000
-- patterns[33]: 0xFF80808080808080
-- patterns[34]: 0x081C22C180010204
-- patterns[35]: 0xFF808080FF080808
-- patterns[36]: 0xF87422478F172271
-- patterns[37]: 0xBF00BFBFB0B0B0B0
-- patterns[38]: 0xFF7FBE5DA2418000
-- patterns[39]: 0xFAF5FAF5A050A050
-- checksum: 0x0
----- HyperTalk script -----
on openStack
global firsttime
global totalcorrect
global numberanswered
global ncards
put the number of cards into ncards
go to first card
put true into firsttime
put 0 into totalcorrect
put 0 into numberanswered
put 0 into background field "percentcorrect"
show background field "answermask" -- hides the answers
set lockText of background field "answer1" to true -- allow editing
set lockText of background field "answer2" to true
set lockText of background field "answer3" to true
set lockText of background field "answer4" to true
set lockText of background field "answer5" to true
set lockText of background field "theQuestion" to true
set lockText of background field "why" to true
hide background button "help"
show background field "reviewmask"
hide menubar
repeat with i = 1 to ncards
put false into background field "got it right" of card i
end repeat
end openStack
on CloseStack
set visible of background button "help" to false
set visible of background field "reviewmask" to true
set visible of background field "gobackmask" to true
end CloseStack
on opencard
global totalcorrect
global ncards
global firsttime
global numberanswered
if numberanswered = ncards then -- all done
pop card
exit opencard
end if
if firsttime then -- first time through
if id of this card <> id of first card then
hide background field "gobackmask"
else
show background field "gobackmask" -- can't go back on card 1
end if
else -- we are in review mode
show background field "gobackmask" -- no goback in review mode
end if
if background field "got it right" = true then -- skip this card
go to next card
else -- this card has not been answered
put round(100 * totalcorrect / the number of cards) into it
put it into background field "percentcorrect"
show background field "percentcorrect" -- it was hidden earlier
-- prevents flickering
put the number of this card into background field "cardnumber"
put ncards into background field "numberofcards" -- so it is updated
-- since by this time the user is reading the question it does not
-- slow things down.
end if
end opencard
on process
global firsttime
global totalcorrect
global numberanswered
global response
global ncards
get background field "correctanswer"
if it = response then
play "Sax Lo" tempo 200 "ce e g a#w."
put true into correct
put true into background field "got it right"
add 1 to totalcorrect
add 1 to numberanswered
else
play "boing" ge
put false into correct
put false into background field "got it right"
end if
put 0 into response
if firsttime then -- check to see if we are at the end of the stack
if id of last card = id of this card then
put false into firsttime
show background button "Help"
hide background field "reviewmask"
show background field "gobackmask"
visual effect wipe right
hide background field "percentcorrect"
end if
end if
if firsttime then
if correct then
visual effect wipe right
hide background field "percentcorrect"
go to next card
else
visual effect wipe right
hide background field "percentcorrect"
go to next card
end if
else
if correct then
visual effect wipe right
hide background field "percentcorrect"
go to next card
else
answer "Would you like to try again?" with "No" or "Yes"
if it = "No" then
put true into background field "got it right"
add 1 to numberanswered
visual effect wipe right
hide background field "percentcorrect"
go to next card
end if
end if
end if
end process